<%@ Page Language="C#" MasterPageFile="~/masterpages/admin.master" AutoEventWireup="true" CodeFile="ProductList.aspx.cs" Inherits="admin_ProductList" Title="Product List Page" %>
<%@ Register Src="~/controls/EmptyGridMessage.ascx" TagPrefix="ucc" TagName="EmptyGridMessage" %>

<asp:Content ID="head" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content" ContentPlaceHolderID="Content" Runat="Server">
	<div class="row filterBox">
		<div class="col">
			<div class="row">
				<div class="col genericFilterText">Product name</div>
				<div class="col genericFilterSeperator">:</div>
				<div class="col genericFilterInput"><asp:TextBox ID="tbxProductName" runat="server" SkinID="GenericFilterTextBox"></asp:TextBox></div>
			</div>
			<div class="row">
				<div class="col genericFilterText">Differ by</div>
				<div class="col genericFilterSeperator">:</div>
				<div class="col genericFilterInput"><asp:TextBox ID="tbxDifferBy" runat="server" SkinID="GenericFilterTextBox"></asp:TextBox></div>
			</div>
			<div class="row">
				<div class="col genericFilterText">Product weight unit</div>
				<div class="col genericFilterSeperator">:</div>
				<div class="col genericFilterInput"><asp:TextBox ID="tbxProductWeightUnit" runat="server" SkinID="GenericFilterTextBox"></asp:TextBox></div>
			</div>
		</div>
        <div class="col">
			<div class="row">
				<div class="col genericFilterText">Product default image url</div>
				<div class="col genericFilterSeperator">:</div>
				<div class="col genericFilterInput"><asp:TextBox ID="tbxProductDefaultImageUrl" runat="server" SkinID="GenericFilterTextBox"></asp:TextBox></div>
			</div>
			<div class="row">
				<div class="col genericFilterText">Product size unit</div>
				<div class="col genericFilterSeperator">:</div>
				<div class="col genericFilterInput"><asp:TextBox ID="tbxProductSizeUnit" runat="server" SkinID="GenericFilterTextBox"></asp:TextBox></div>
			</div>
			<div class="row">
				<div class="col genericFilterText">Sort token</div>
				<div class="col genericFilterSeperator">:</div>
				<div class="col genericFilterInput"><asp:TextBox ID="tbxSortToken" runat="server" SkinID="GenericFilterTextBox"></asp:TextBox></div>
			</div>
			<div class="row">
                <div class="col genericFilterText">&nbsp;</div>
                <div class="col genericFilterSeperator">&nbsp;</div>
                <div class="col genericFilterInput filterButton"><asp:Button ID="btnFilter" runat="server" Text="Search" OnClick="Filter_Click" SkinID="genericButton" /></div>
            </div>
        </div>
	</div>  
    <div class="row">
    <asp:GridView ID="grvProductList" runat="server" AllowPaging="true" AllowSorting="true" 
        AutoGenerateColumns="false" DataKeyNames="Id" PageSize="4" OnRowCommand="grvProductList_RowCommand" 
        OnRowDataBound="grvProductList_RowDataBound" SkinID="GenericAdminList" OnSorting="grvProductList_Sorting" >  
        <Columns>
            <asp:BoundField DataField="Id" HeaderText="Id" SortExpression="id" />
			<asp:BoundField DataField="ProductName" HeaderText="Product name" SortExpression="product_name" />
			<asp:BoundField DataField="ProductDefaultImageUrl" HeaderText="Product default image url" SortExpression="product_default_image_url" />
			<asp:BoundField DataField="ProductPrice" HeaderText="Product price" SortExpression="product_price" />
			<asp:BoundField DataField="ProductBrandId" HeaderText="Product brand id" SortExpression="product_brand_id" />
			<asp:BoundField DataField="ProductCategoryId" HeaderText="Product category id" SortExpression="product_category_id" />
			<asp:BoundField DataField="MainProductId" HeaderText="Main product id" SortExpression="main_product_id" />
			<asp:BoundField DataField="DifferBy" HeaderText="Differ by" SortExpression="differ_by" />
			<asp:CheckBoxField DataField="IsProductInSale" HeaderText="Product in sale" ItemStyle-HorizontalAlign="Center" SortExpression="is_product_in_sale" />
			<asp:BoundField DataField="SaleTimePrice" HeaderText="Sale time price" SortExpression="sale_time_price" />
			<asp:BoundField DataField="Rating" HeaderText="Rating" SortExpression="rating" />
			<asp:BoundField DataField="TotalRater" HeaderText="Total rater" SortExpression="total_rater" />
			<asp:CheckBoxField DataField="IsActive" HeaderText="Active" ItemStyle-HorizontalAlign="Center" SortExpression="is_active" />
			<asp:CheckBoxField DataField="IsFeatured" HeaderText="Featured" ItemStyle-HorizontalAlign="Center" SortExpression="is_featured" />
			<asp:CheckBoxField DataField="IsNewArrival" HeaderText="New arrival" ItemStyle-HorizontalAlign="Center" SortExpression="is_new_arrival" />
			<asp:CheckBoxField DataField="IsBestSeller" HeaderText="Best seller" ItemStyle-HorizontalAlign="Center" SortExpression="is_best_seller" />
			<asp:BoundField DataField="ProductLength" HeaderText="Product length" SortExpression="product_length" />
			<asp:BoundField DataField="ProductWidth" HeaderText="Product width" SortExpression="product_width" />
			<asp:BoundField DataField="ProductHeight" HeaderText="Product height" SortExpression="product_height" />
			<asp:BoundField DataField="ProductWieght" HeaderText="Product wieght" SortExpression="product_wieght" />
			<asp:BoundField DataField="ProductSizeUnit" HeaderText="Product size unit" SortExpression="product_size_unit" />
			<asp:BoundField DataField="ProductWeightUnit" HeaderText="Product weight unit" SortExpression="product_weight_unit" />
			<asp:BoundField DataField="ItemInStock" HeaderText="Item in stock" SortExpression="item_in_stock" />
			<asp:BoundField DataField="SortToken" HeaderText="Sort token" SortExpression="sort_token" />
            <asp:TemplateField>
                <ItemStyle HorizontalAlign="Center" />
                <HeaderTemplate>
                    Edit
                </HeaderTemplate>
                <ItemTemplate>
                    <asp:ImageButton ID="editButton" AlternateText="edit"
                        runat="server" CommandName="editCommand" />
                </ItemTemplate>               
            </asp:TemplateField>
            <asp:TemplateField>
                <ItemStyle HorizontalAlign="Center" />
                <HeaderTemplate>
                    Delete
                </HeaderTemplate>
                <ItemTemplate>
                    <asp:ImageButton ID="deleteButton" AlternateText="delete"
                        runat="server" CommandName="deleteCommand" />
                </ItemTemplate>               
            </asp:TemplateField>
            <asp:TemplateField>
                <ItemStyle HorizontalAlign="Center" />
                <HeaderTemplate>
                    <asp:CheckBox runat="server" ID="selectAll" />
                </HeaderTemplate>
                <ItemTemplate>
                    <asp:CheckBox runat="server" ID="rowSelect" />
                </ItemTemplate>                
            </asp:TemplateField>
        </Columns>
        <EmptyDataTemplate>
            <ucc:EmptyGridMessage ID="emptyGridMessage" runat="server" />
        </EmptyDataTemplate>
    </asp:GridView>
    <div class="row genericGridFooter">
        <div class="col smallFont genericGridPageInfo" >
			<asp:Label ID="pagerLabel" runat="server" ></asp:Label>
		</div>
            <div class="col smallFont genericGridPager" >
				<asp:Repeater ID="pager" runat="server" OnItemCommand="Pager_Command" OnItemDataBound="Pager_DataBound">
                    <HeaderTemplate>
                        <asp:ImageButton ID="btnFirst" ImageAlign="AbsMiddle" AlternateText="First" runat="server" CommandName="first" />
                        <asp:ImageButton ID="btnPrev" ImageAlign="AbsMiddle" AlternateText="Prev" runat="server" CommandName="prev" />
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:LinkButton ID="lbtMid" runat="server" Text='<%#  Convert.ToInt32(Container.DataItem) +1 %>' 
                            CommandName="paging" CommandArgument='<%#  Container.DataItem %>' />
                    </ItemTemplate>
                    <FooterTemplate>
                        <asp:ImageButton ID="btnNext" ImageAlign="AbsMiddle" AlternateText="Next" runat="server" CommandName="next"  />
                        <asp:ImageButton ID="btnLast" ImageAlign="AbsMiddle" AlternateText="Last" runat="server" CommandName="last" />
                    </FooterTemplate>
                </asp:Repeater>
			</div>
        </div>
        <div class="row genericGridButtons">
			<asp:Button ID="btnAddNew" runat="server" Text="Add Another" OnClick="AddNew_Click" SkinID="genericButton" />
			<asp:Button ID="btnDeleteSelected" runat="server" Text="Delete Selected Items" OnClick="Delete_Selected" SkinID="genericButton" />
		</div>
    </div>
</asp:Content>

